home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 41 / Amiga Format CD41 (1999-06)(Future Publishing)(GB)[!][issue 1999-07].iso / -seriously_amiga- / programming / other / gui4cli / g4c / ced / addlink.g < prev    next >
Text File  |  1999-04-29  |  3KB  |  161 lines

  1. G4C
  2.  
  3. WINBIG 199 27 442 35 "Link selection to:"
  4. WinType 11110001
  5. resinfo 8 660 270
  6.  
  7. ; varpath cedguide.gc
  8. BOX 0 0 0 0 out button
  9.  
  10. xOnLoad
  11. linkmode = NODE
  12. guiopen addlink.g
  13.  
  14. xonreload
  15. guiopen addlink.g
  16.  
  17. xonopen
  18. linkname = ''
  19. update addlink.g 1 ''
  20.  
  21. xONQUIT
  22. guiquit getlinkmode
  23.  
  24. ; -------------------------------------------------------------
  25. ;       Get link name
  26. ; -------------------------------------------------------------
  27.  
  28. XTEXTIN 5 3 433 14 "" linkname "" 140
  29. gadhelp 'Enter the name of the node or file or rexx script'
  30. gadid 1
  31. gosub addlink.g dolink
  32.  
  33. XBUTTON 276 18 80 13 "Browse.."
  34. gadhelp 'Select node or file through a requester'
  35. docase $linkmode
  36.   case = NODE
  37.     ; get current filename
  38.     sendrexx $cedbar.gc/cedport 'status filename'
  39.     filename = $$rexxret
  40.     extract filename PATH filepath
  41.     extract filename FILE filename
  42.     ReqFile -1 -1 300 -40 "Select Node" LOAD linkname #$filepath
  43.     extract linkname file linkname
  44.     update addlink.g 1 $linkname
  45.     break
  46.   case = FILE
  47.     ReqFile -1 -1 300 -40 "Select File" LOAD linkname sys:
  48.     JoinFile $linkname "MAIN" linkname
  49.     update addlink.g 1 $linkname
  50.     break
  51.   case = SYSTEM
  52.     ReqFile -1 -1 300 -40 "Select Command" LOAD linkname c:
  53.     update addlink.g 1 $linkname
  54.     break
  55.   case = RX
  56.     ReqFile -1 -1 300 -40 "Select Rexx script" LOAD linkname sys:
  57.     update addlink.g 1 $linkname
  58.     break
  59.   case = RXS
  60.     ;
  61.     break
  62. endcase
  63. setgad addlink.g 1 ON
  64.  
  65. ; -------------------------------------------------------------
  66. ;       OK..
  67. ; -------------------------------------------------------------
  68.  
  69. XBUTTON 357 18 80 13 "OK"
  70. gadhelp 'Proceed..'
  71. gadkey #13
  72. gosub addlink.g dolink
  73.  
  74. ; do the actual link insertion - also called from the textin
  75. xRoutine dolink
  76. guiclose addlink.g
  77. if $linkname > ' '
  78.   SendRexx $cedbar.gc/cedport cut
  79.   SendRexx $cedbar.gc/cedport 'text @{\" '
  80.   SendRexx $cedbar.gc/cedport paste
  81.   SendRexx $cedbar.gc/cedport 'text  \" '
  82.   if $linkmode = NODE
  83.   or $linkmode = FILE
  84.     SendRexx $cedbar.gc/cedport 'text LINK \"$linkname\"}'
  85.   else
  86.     SendRexx $cedbar.gc/cedport 'text $linkmode \"$linkname\"}'
  87.   endif
  88. endif
  89.  
  90. ; -------------------------------------------------------------
  91. ;       Choose type of link
  92. ; -------------------------------------------------------------
  93.  
  94. CTEXT 6 18 "Type:" #screen 8 2 0 00011
  95.  
  96. TEXT 75 18 195 13 'Link to Node' 100 BOX
  97. gadhelp 'Displays the link type'
  98. gadid 2
  99.  
  100. XBUTTON 48 18 23 13 "?"
  101. gadhelp 'Change link type'
  102. guiopen getlinkmode
  103.  
  104.  
  105. ; #############################################################
  106. ;       GETLINKMODE
  107. ; #############################################################
  108.  
  109. NEWFILE getlinkmode
  110. WINBIG 156 78 158 61 ''
  111. WinType 00001000
  112. winonmouse 15 15
  113. resinfo 8 660 270
  114. varpath addlink.g
  115. BOX 0 0 0 0 out button
  116.  
  117. xONRMB
  118. guiclose getlinkmode
  119.  
  120. xONInactive
  121. guiclose getlinkmode
  122.  
  123. XRADIO 10 5 17 9 linkmode 2
  124. gadhelp 'Choose type of link'
  125. gadtitle right
  126. RSTR "Link to Node" NODE
  127. RSTR "Link to File" FILE
  128. RSTR "Run Command" SYSTEM
  129. RSTR "Run Rexx script" RX
  130. RSTR "Run Rexx line" RXS
  131. guiclose getlinkmode
  132. docase $linkmode
  133.   case = NODE
  134.     update addlink.g 2 'Link to Node'
  135.     break
  136.   case = FILE
  137.     update addlink.g 2 'Link to File'
  138.     break
  139.   case = SYSTEM
  140.     update addlink.g 2 'Run Command'
  141.     break
  142.   case = RX
  143.     update addlink.g 2 'Run Rexx script'
  144.     break
  145.   case = RXS
  146.     update addlink.g 2 'Run Rexx line'
  147.     break
  148. endcase
  149. ; reset any entries since we've changed mode
  150. linkname = ''
  151. update addlink.g 1 ''
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.